const astate_map={
    'inputting':'walk',
    'acting':'walk',
    'undecided':'walk',
    'waiting':'wait'
}
export class MotionResolver{
    static resolve(battler){
        if (battler.isInputting() || battler.isActing()) {
            return 'walk';
        } else{
            let stateMotion = battler.stateMotionIndex();
            if (stateMotion == 3) return 'dead'; 
            else if (stateMotion == 2) return 'sleep';
            else if (battler.isChanting()) return 'chant';
            else if (battler.isGuard() || battler.isGuardWaiting()) return 'guard';
            else if (stateMotion == 1) return 'abnormal';
            else if (battler.isDying()) return 'dying';
            else if (battler.isUndecided())return 'walk';
        }
        return 'wait';
    }

    static resolveAState(astate){
        return astate_map[astate]??'wait';
    }
}